import requests

def get_content(url):
    print('正在爬取：',url)
    response = requests.get(url=url, headers=headers)
    if response.status_code == 200:
        return response.content

def parse_content(content):
    print('响应数据的长度为', len(content))

if __name__ == '__main__':
    url = [
        'http://www.baidu.com'
    ]
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36'
    }

    for url in url:
        content = get_content(url)
        parse_content(content)